class tScoreScreen
{
  int mouseClicks;
  int numScreens;
  int nextGameState;
  public boolean clearScores;
  String splashScreen;
  
  tScoreScreen()
  {
    this.reset();
  }
  
  void reset()
  {
    mouseClicks = 0;
    numScreens = 2;
    nextGameState = 2;
    clearScores = false;
    splashScreen = "scoreScreen";
  }
  
  void resetCredits()
  {
    this.reset();
    this.numScreens = 1;
    splashScreen = "creditsScreen";
  }
  
  void setNextGameState(int ngs)
  {
    nextGameState = ngs;
  }
  
  void update()
  {
    if (mouseJustPressed[0] == true)
    {
      mouseClicks++;
    }
    
    if (mouseClicks >= numScreens)
    {
      if (clearScores)
      {
        clearScores(difficulty);
      }
      setGameState(nextGameState);
      mouseClicks = 0;
    }
  }
  
  void doDraw()
  {
    if (splashScreen == "scoreScreen")
    {
      doDrawScoreScreen();
    }
    else if (splashScreen == "creditsScreen")
    {
      doDrawCreditsScreen();
    }
  }
  
  void doDrawCreditsScreen()
  {
    image(img.credits, 0, 0);
  }
  
  void doDrawScoreScreen()
  {
    switch (mouseClicks)
    {
      case 0:
        displayScores();
        break;
      case 1:
      default:
        if(userSystem.isValid)
        {
          drawBackground();
          userSystem.displaySystem();
        }
        else
        {
          drawBackground();
          userSystem.explode();
        }
        break;
    }
  }
}
